package com.example.cloud_bus_config_provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/provider")
@RefreshScope
public class ProviderController {

    @Value("${file.path}")
    private String filePath;

    @RequestMapping("/method")
    public String method() {
        System.out.println(filePath);
        return filePath;
    }

    @RequestMapping("/method2")
    public String method2(String message) {
        System.out.println(filePath + "--- message: " + message);
        return filePath + "--- message: " + message;
    }
}
